From 9c47bd3d1e8e66c787f3dbf1f475dd536ab5d184 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 8 Feb 2007 11:03:29 +0000 Subject: [PATCH] [XEN] kexec: Remove asm/kexec.h. Move the single inline function into arch specific machine_kexec.c with the other arch specific kexec functions. IA64 already had a stub in both kexec.h and machine_kexec.c. Signed-off-by: Ian Campbell --- xen/arch/powerpc/machine_kexec.c | 5 ++++ xen/arch/x86/crash.c | 1 - xen/arch/x86/machine_kexec.c | 15 +++++++++++- xen/common/kexec.c | 1 - xen/include/asm-ia64/kexec.h | 25 ------------------- xen/include/asm-powerpc/kexec.h | 25 ------------------- xen/include/asm-x86/kexec.h | 20 --------------- xen/include/asm-x86/x86_32/kexec.h | 39 ------------------------------ xen/include/asm-x86/x86_64/kexec.h | 38 ----------------------------- xen/include/xen/kexec.h | 1 + 10 files changed, 20 insertions(+), 150 deletions(-) delete mode 100644 xen/include/asm-ia64/kexec.h delete mode 100644 xen/include/asm-powerpc/kexec.h delete mode 100644 xen/include/asm-x86/kexec.h delete mode 100644 xen/include/asm-x86/x86_32/kexec.h delete mode 100644 xen/include/asm-x86/x86_64/kexec.h diff --git a/xen/arch/powerpc/machine_kexec.c b/xen/arch/powerpc/machine_kexec.c index 2debd26a7e..51ddd75890 100644 --- a/xen/arch/powerpc/machine_kexec.c +++ b/xen/arch/powerpc/machine_kexec.c @@ -19,6 +19,11 @@ void machine_reboot_kexec(xen_kexec_image_t *image) printk("STUB: " __FILE__ ": %s: not implemented\n", __FUNCTION__); } +void machine_kexec(xen_kexec_image_t *image) +{ + printk("STUB: " __FILE__ ": %s: not implemented\n", __FUNCTION__); +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/crash.c b/xen/arch/x86/crash.c index 73eb4724a8..cae1768633 100644 --- a/xen/arch/x86/crash.c +++ b/xen/arch/x86/crash.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c index 81c392a7d3..54fa466793 100644 --- a/xen/arch/x86/machine_kexec.c +++ b/xen/arch/x86/machine_kexec.c @@ -15,11 +15,15 @@ #include #include #include -#include #include #include #include +typedef void (*relocate_new_kernel_t)( + unsigned long indirection_page, + unsigned long page_list, + unsigned long start_address); + int machine_kexec_load(int type, int slot, xen_kexec_image_t *image) { unsigned long prev_ma = 0; @@ -94,6 +98,15 @@ void machine_reboot_kexec(xen_kexec_image_t *image) BUG(); } +void machine_kexec(xen_kexec_image_t *image) +{ + relocate_new_kernel_t rnk; + + rnk = (relocate_new_kernel_t) image->page_list[1]; + (*rnk)(image->indirection_page, (unsigned long)image->page_list, + image->start_address); +} + /* * Local variables: * mode: C diff --git a/xen/common/kexec.c b/xen/common/kexec.c index a9e85cad7f..80314a6673 100644 --- a/xen/common/kexec.c +++ b/xen/common/kexec.c @@ -6,7 +6,6 @@ * - Magnus Damm */ -#include #include #include #include diff --git a/xen/include/asm-ia64/kexec.h b/xen/include/asm-ia64/kexec.h deleted file mode 100644 index 45756e8f64..0000000000 --- a/xen/include/asm-ia64/kexec.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef __IA64_KEXEC_H__ -#define __IA64_KEXEC_H__ - -#include /* for printk() used in stub */ -#include -#include -#include - -static inline void machine_kexec(xen_kexec_image_t *image) -{ - printk("STUB: " __FILE__ ": %s: not implemented\n", __FUNCTION__); -} - -#endif /* __IA64_KEXEC_H__ */ - -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ - diff --git a/xen/include/asm-powerpc/kexec.h b/xen/include/asm-powerpc/kexec.h deleted file mode 100644 index f228972047..0000000000 --- a/xen/include/asm-powerpc/kexec.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _ASM_KEXEC_H__ -#define _ASM_KEXEC_H__ - -#include /* for printk() used in stub */ -#include -#include -#include - -static inline void machine_kexec(xen_kexec_image_t *image) -{ - printk("STUB: " __FILE__ ": %s: not implemented\n", __FUNCTION__); -} - -#endif /* _ASM_KEXEC_H__ */ - -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ - diff --git a/xen/include/asm-x86/kexec.h b/xen/include/asm-x86/kexec.h deleted file mode 100644 index d137337da0..0000000000 --- a/xen/include/asm-x86/kexec.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __X86_KEXEC_H__ -#define __X86_KEXEC_H__ - -#ifdef __x86_64__ -#include -#else -#include -#endif - -#endif /* __X86_KEXEC_H__ */ - -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/include/asm-x86/x86_32/kexec.h b/xen/include/asm-x86/x86_32/kexec.h deleted file mode 100644 index cb4ada715e..0000000000 --- a/xen/include/asm-x86/x86_32/kexec.h +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** - * kexec.h - * - * Based heavily on machine_kexec.c and kexec.h from Linux 2.6.19-rc1 - * - */ - -#ifndef __X86_KEXEC_X86_32_H__ -#define __X86_KEXEC_X86_32_H__ - -#include -#include - -typedef asmlinkage void (*relocate_new_kernel_t)( - unsigned long indirection_page, - unsigned long page_list, - unsigned long start_address, - unsigned int has_pae); - -static inline void machine_kexec(xen_kexec_image_t *image) -{ - relocate_new_kernel_t rnk; - - rnk = (relocate_new_kernel_t) image->page_list[1]; - (*rnk)(image->indirection_page, (unsigned long)image->page_list, - image->start_address, (unsigned long)cpu_has_pae); -} - -#endif /* __X86_KEXEC_X86_32_H__ */ - -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/include/asm-x86/x86_64/kexec.h b/xen/include/asm-x86/x86_64/kexec.h deleted file mode 100644 index c54dbb9ba6..0000000000 --- a/xen/include/asm-x86/x86_64/kexec.h +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * kexec.h - * - * Based heavily on machine_kexec.c and kexec.h from Linux 2.6.19-rc1 - * - */ - -#ifndef __X86_64_KEXEC_H__ -#define __X86_64_KEXEC_H__ - -#include -#include - -typedef void (*relocate_new_kernel_t)( - unsigned long indirection_page, - unsigned long page_list, - unsigned long start_address); - -static inline void machine_kexec(xen_kexec_image_t *image) -{ - relocate_new_kernel_t rnk; - - rnk = (relocate_new_kernel_t) image->page_list[1]; - (*rnk)(image->indirection_page, (unsigned long)image->page_list, - image->start_address); -} - -#endif /* __X86_64_KEXEC_H__ */ - -/* - * Local variables: - * mode: C - * c-set-style: "BSD" - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: nil - * End: - */ diff --git a/xen/include/xen/kexec.h b/xen/include/xen/kexec.h index be09c0a1ab..523846af06 100644 --- a/xen/include/xen/kexec.h +++ b/xen/include/xen/kexec.h @@ -25,6 +25,7 @@ int machine_kexec_load(int type, int slot, xen_kexec_image_t *image); void machine_kexec_unload(int type, int slot, xen_kexec_image_t *image); void machine_kexec_reserved(xen_kexec_reserve_t *reservation); void machine_reboot_kexec(xen_kexec_image_t *image); +void machine_kexec(xen_kexec_image_t *image); void kexec_crash(void); void kexec_crash_save_cpu(void); crash_xen_info_t *kexec_crash_save_info(void); -- 2.30.2